<?php /* Smarty version Smarty-3.1.8, created on 2012-06-15 01:57:15
         compiled from "tmpl/crud_template/controller_list.html" */ ?>
<?php /*%%SmartyHeaderCode:791551324fc491bfb6b270-67498848%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '04342b7ca671399f5fccea4f2be796608e8d66a4' => 
    array (
      0 => 'tmpl/crud_template/controller_list.html',
      1 => 1339750629,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '791551324fc491bfb6b270-67498848',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_4fc491bfbb88a2_11673212',
  'variables' => 
  array (
    'controller' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_4fc491bfbb88a2_11673212')) {function content_4fc491bfbb88a2_11673212($_smarty_tpl) {?><<?php ?>?php

require("lib/Util.php");
require_once("<?php echo $_smarty_tpl->tpl_vars['controller']->value;?>
_helper.php");

$items_per_page = 10;

$tpl_engine = get_tpl_engine();

$page_now = param_int("page");
$db = get_database_handler();
$count = $db->count();

if($page_now < 1 || $page_now > ceil($count/$items_per_page)){
 $page_now =1;
}



$list = $db->bind_select_where("order by id asc limit ".(($page_now-1)*$items_per_page).", $items_per_page");

$tpl_engine->assign("pagefooter",pagefooter("<?php echo $_smarty_tpl->tpl_vars['controller']->value;?>
_list.php?",$page_now,$count,$items_per_page));

$tpl_engine->assign("list",$list);

$tpl_engine->display('tmpl/<?php echo $_smarty_tpl->tpl_vars['controller']->value;?>
/list.html');


?<?php ?>><?php }} ?>